PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Commands

Commands are described in detail in Commands.

A command is a request for action. In AppleScript, you can use application commands, which are defined in each application's dictionary; AppleScript commands, which are defined and handled by AppleScript; or scripting addition commands, which are defined and handled by AppleScript extensions called scripting additions.

Table A-4 lists standard application commands and AppleScript commands. For information about scripting addition commands, see Scripting Additions and Scripting Addition Commands. You can also refer to the AppleScript section of the Mac OS Help Center, or visit the AppleScript website at

www.apple.com/applescript

The syntax shown for standard application commands is the syntax supported by most applications. Individual applications can extend or change the way the standard application commands work.

For information about how a specific application handles a particular application command, see the application's dictionary. For more detailed descriptions of the commands listed here, see Commands

IMPORTANT

Some syntax statements use the continuation character (¬) to identify text that, if included, must appear on the same line. The ¬ character is not a required part of the syntax, although you can use it to extend a statement beyond one line.

Table A-4   Command syntax 

Command

Syntax

Result

close
(application command)
close referenceToObject None
close referenceToObject saving in referenceToFile
close referenceToObject saving saveOption
close referenceToObject saving in referenceToFile saving saveOption
copy
(AppleScript command)
( copy | put ) expression ( to | into) variablePattern Value copied
count
(AppleScript command)
count compositeValue count [ each | every ] className ( in | of ) ¬
    compositeValue
Integer
number of compositeValue number of pluralClassName ( in | of ) compositeValue
count
(application command)
count [ each | every ] className count [ each | every ] className
   ( in | of ) referenceToObject ]
Integer or
list of integers
number of className number of className [ ( in | of ) referenceToObject ]
delete
(application command)
delete referenceToObject None
duplicate
(application command)
duplicate referenceToObject Reference
duplicate referenceToObject to referenceToLocation
error
(AppleScript command)
error ¬
[ errorMessage ] ¬
[ number errorNumber ] ¬
[ from offendingObject ] ¬
[ partial result resultList ] ¬
[ to expectedType ]
exists
(application command)
exists referenceToObject Boolean
referenceToObject exists
get
(AppleScript command)
get expression get expression as className Value of expression
get
(application command)
get referenceToObject get referenceToObject as className Value of reference
launch
(application command)
launch launch referenceToApplication None
make
(application command)
make [new] className at referenceToLocation [with properties { propertyLabel : propertyValue [, propertyLabel : propertyValue ]...} ] [with data dataValue ] Reference to the new object
move
(application command)
move referenceToObject to referenceToLocation Reference to the moved object
open
(application command)
open referenceToFile None
open listOfFiles
print
(application command)
print referenceToObject None
quit
(application command)
quit referenceToApplication None
quit referenceToApplication saving saveOption
reopen
(application command)
reopen reopen referenceToApplication None
run
(AppleScript command)
run run scriptObjectVariable The value, if any, returned by the script object
run
(application command)
run run referenceToApplication None
save
(application command)
save referenceToObject None
save referenceToObject in referenceToFile
set
(AppleScript command)
set variablePattern to expression expression returning variablePattern Value assigned
set
(application command)
set referencePattern to expression expression returning referencePattern Value assigned

© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)